import React from "react";

class MyComponent extends React.Component {
  constructor(props) {
    super(props);
    this.handleClick = this.handleClick.bind(this);
  }
  handleClick() {
    this.refs.myTextInput.focus();
  }
  render() {
    return (
      <div
        onClick={this.handleClick}
        style={{
          border: "1px solid",
          width: "200px",
          height: "50px",
          margin: "0 auto",
          lineHeight: "50px",
          background:'#fff'
        }}
      >
        <input
          type="text"
          ref="myTextInput"
          style={{ width: "80%", border: "none",outline:'none' }}
        />
      </div>
    );
  }
}

export default MyComponent;
